<template>
  <div v-if="mainStore.isLoading" 
       class="loading"
       @click="loadingClick">
    <div class="bg">
      <img src="@/assets/img/home/full-screen-loading.gif" alt="">
    </div>
  </div>
</template>

<script setup>
import useMainStore from '@/store/modules/main';
  const mainStore =  useMainStore()
  const loadingClick = () => {
    mainStore.isLoading = false
  }
</script>

<style lang="less" scoped>
.loading{
   position: fixed;
   left: 0;
   right: 0;
   top: 0;
   bottom: 0;
   display: flex;
   justify-content: center;
   align-items: center;
   background-color: rgba(0,0,0, .3);
   z-index: 99;
   .bg{
     display: flex;
     justify-content: center;
     align-items: center;
     width: 104px;
     height: 104px;
     background: url(@/assets/img/home/loading-bg.png) 0 0 / 100% 100% ;
     img {
       margin-bottom: 10px;
       width: 70px;
       height: 70px;
     }
   }
 }
</style>
